package light.im.loginserver.domain.dal;

import light.im.loginserver.domain.user.model.User;

/**
 * 查询用户信息
 * @author ruby
 *
 */
public class UserDAO {

	private static UserDAO instance = new UserDAO();
	public static UserDAO getInstance()
	{
		return instance;
	}

	
	public User getUser(String userId) throws DAException
	{
		User u = new User();
		u.setUserId(userId);
		u.setPassword("123");
		u.setNickName("万里独行");
		return u;
	}
	
	public void saveUser(User user) throws DAException
	{
		
	}
	
	
//	public List<FriendCatalog> getFriends(String userId)
//	{
////		List<FriendCatalog> catas = new
//	}
	
	public static void main(String[] args) throws DAException {

		User u = new User();
		u.setUserId("ruby");
		u.setPassword("123");
		u.setNickName("万里独行");
		UserDAO.getInstance().saveUser(u);
		u = UserDAO.getInstance().getUser("ruby");
		System.out.println(u.getNickName());
	}

}
